Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Propagate intra_op_parallelism_threads from SessionOptions to xla::LocalClientOptions #30996

Merged
merged 2 commits into from
Jul 26, 2019

Conversation

plopresti
Copy link
Contributor

@plopresti plopresti commented Jul 24, 2019

With CPU Tensorflow, when we set intra_op_parallelism_threads to 1 in the SessionOptions config, the XLA CPU backend still spawns a huge number of threads because xla::LocalClientOptions defaults this setting to -1, which causes the CPU backend to spawn one thread per core.

Fix is to propagate this setting from the SessionOptions into xla::LocalClientOptions when creating the xla::LocalClient.

…calClientOptions.

With CPU Tensorflow, when we set intra_op_parallelism_threads to 1 in
the SessionOptions config, the XLA CPU backend still spawns a huge
number of threads because XlaDevice does not propagate this option
when it creates an xla::LocalClient.

Fix is a fairly simple.
@tensorflow-bot tensorflow-bot bot added the size:S CL Change Size: Small label Jul 24, 2019
@rthadur rthadur self-assigned this Jul 24, 2019
@rthadur rthadur added this to Assigned Reviewer in PR Queue via automation Jul 24, 2019
@rthadur rthadur requested a review from thomasjoerg July 24, 2019 17:08
@rthadur rthadur added the comp:xla XLA label Jul 24, 2019
@tensorflow-bot tensorflow-bot bot added kokoro:force-run Tests on submitted change ready to pull PR ready for merge process labels Jul 25, 2019
PR Queue automation moved this from Assigned Reviewer to Approved by Reviewer Jul 25, 2019
@kokoro-team kokoro-team removed the kokoro:force-run Tests on submitted change label Jul 25, 2019
@tensorflow-copybara tensorflow-copybara merged commit 623c35d into tensorflow:master Jul 26, 2019
PR Queue automation moved this from Approved by Reviewer to Merged Jul 26, 2019
tensorflow-copybara pushed a commit that referenced this pull request Jul 26, 2019
@plopresti plopresti deleted the num_threads branch July 26, 2019 16:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes comp:xla XLA ready to pull PR ready for merge process size:S CL Change Size: Small
Projects
PR Queue
  
Merged
Development

Successfully merging this pull request may close these issues.

None yet

6 participants